Conversation
Adds handling for "refresh_token_expires_in" and checks for refresh token expiration in refreshTokensIfNeeded. Fixes #565
| } | ||
|
|
||
| - (void)testRefreshTokensIfNeededWithCompletion_noRefresh_givenRefreshTokenExpired { | ||
| NSTimeInterval expiresIn = -10; |
There was a problem hiding this comment.
Can you make the other tokens not expired, so that we're testing only the specific refresh token behavior?
There was a problem hiding this comment.
If I do this then this would not reach the refresh token logic. This is due to the fact that we check if either IdToken and/or AccessToken are expired first (ref). If both of these tokens aren't expired, then we immediately return them to the client thus not reaching the refreshToken check that comes after.
The test where both of the tokens are not expired is already made here. Although this doesn't have the refreshToken expiration, it should produce the same output. I could add the expired refreshToken to this test if we want to be safe.
Separately, I could add another test where if only one of the tokens are expired, then we should still continue to the refreshToken logic.
Let me know what you think.
There was a problem hiding this comment.
Ah! All good then, thank you for explaining :)
w-goog
left a comment
There was a problem hiding this comment.
Approved pending the one requested change :)
In our token response from the server, we receive a "refresh_token_expires_in" value. This PR adds handling for this value and checks for refresh token expiration in refreshTokensIfNeeded.
Fixes #565